# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cisco5crack
pkgver=2.c4b228c
pkgrel=4
groups=('blackarch' 'blackarch-cracker' 'blackarch-crypto')
pkgdesc='Crypt and decrypt the cisco enable 5 passwords.'
arch=('x86_64' 'aarch64')
url='https://github.com/madrisan/cisco5crack'
license=('GPL2')
makedepends=('git')
source=("git+https://github.com/madrisan/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --sbindir=/usr/bin
  else
    ./configure --build=arm --prefix=/usr --sbindir=/usr/bin
  fi

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

